This invention relates to stream data analyzing processing. More particularly, this invention relates to processing of analyzing stream data with the use of an approximate expression.
In recent years, along with the increase in the amount of data to be processed, stream data processing systems that allow real-time data compilation and real-time data analysis are attracting attention. Stream data processing systems process stream data, which is a string of time-series data arriving consecutively.
Stream data processing systems execute data processing in accordance with a query defined in advance. A query is a scenario indicating data to be processed and the specifics of the processing, and is written in Continuous Query Language (CQL).
Stream data keeps arriving consecutively without a break, which makes it necessary to extract data about which computation is performed. Processing of analyzing stream data therefore uses sliding window in order to cut a finite data set out of stream data.
There are roughly two types of sliding window, specifically, count-based sliding window for holding n pieces of time-series data that precede a processing target time, and time-based sliding window for holding n hours of time-series data that precede a processing target time.
By using sliding window, for example, count-based sliding window, n pieces of input information preceding an arbitrary time can be compiled and analyzed in substantially real time. Stream data processing systems therefore enable one to analyze the state at the current time and deal with a future data change that is predicted.
In stream data processing systems, a computer that processes stream data uses sliding window to cut out time-series data, and analyzes the relation between a time and a target value (metrics) with respect to the cut out time-series data. This computer calculates a time-metrics relational expression (approximate expression) as the result of the analysis. A future change in value can thus be predicted.
The least square method is known as a method of calculating a relational expression of the relation between a time and a target value. For example, in the case of using count-based sliding window for extracting n pieces of time-series data to approximate the relation between a time xi and metrics yi with a linear expression “y=ax+b”, the values of the coefficients a and b are respectively calculated by Expression (1) and Expression (2), where i is a natural number indicating the place in the order of the time-series data.
                    a        =                                            n              ⁢                                                          ⁢              Σ              ⁢                                                          ⁢                              x                i                            ⁢                              y                i                                      -                          Σ              ⁢                                                          ⁢                              x                i                            ⁢              Σ              ⁢                                                          ⁢                              y                i                                                                        n              ⁢                                                          ⁢              Σ              ⁢                                                          ⁢                              x                i                2                                      -                                          (                                  Σ                  ⁢                                                                          ⁢                                      x                    i                                                  )                            2                                                          (        1        )                                b        =                                            Σ              ⁢                                                          ⁢                              x                i                2                            ⁢              Σ              ⁢                                                          ⁢                              y                i                                      -                          Σ              ⁢                                                          ⁢                              x                i                            ⁢                              y                i                            ⁢              Σ              ⁢                                                          ⁢                              x                i                                                                        n              ⁢                                                          ⁢              Σ              ⁢                                                          ⁢                              x                i                2                                      -                                          (                                  Σ                  ⁢                                                                          ⁢                                      x                    i                                                  )                            2                                                          (        2        )            
Expression (1) and Expression (2) are solutions of an equation expressed as Expression (3).
                                          (                                                                                ∑                                                                                  ⁢                                          x                      i                      2                                                                                                            ∑                                                                                  ⁢                                          x                      i                                                                                                                                        ∑                                                                                  ⁢                                          x                      i                                                                                                            ∑                                                                                  ⁢                    1                                                                        )                    ⁢                      (                                                            a                                                                              b                                                      )                          =                  (                                                                      ∑                                                                          ⁢                                                            x                      i                                        ⁢                                          y                      i                                                                                                                                            ∑                                                                          ⁢                                      y                    i                                                                                )                                    (        3        )            